<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>常见问题 | Luckysheet文档</title>
    <meta name="generator" content="VuePress 1.7.1">
    
    <meta name="description" content="Luckysheet ，一款纯前端类似excel的在线表格，功能强大、配置简单、完全开源。本站包含官方配置文档,API,教程。">
    <meta property="article:modified_time" content="2020-12-17T08:23:07.000Z">
    <meta property="og:title" content="常见问题">
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://mengshukeji.github.io/LuckysheetDemo/zh/guide/FAQ.html">
    <meta name="twitter:title" content="常见问题">
    <meta name="twitter:url" content="https://mengshukeji.github.io/LuckysheetDemo/zh/guide/FAQ.html">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:label1" content="Written by">
    
    <link rel="preload" href="/LuckysheetDocs/assets/css/0.styles.48756c9a.css" as="style"><link rel="preload" href="/LuckysheetDocs/assets/js/app.fd749708.js" as="script"><link rel="preload" href="/LuckysheetDocs/assets/js/2.08ae9631.js" as="script"><link rel="preload" href="/LuckysheetDocs/assets/js/25.af0769a6.js" as="script"><link rel="prefetch" href="/LuckysheetDocs/assets/js/10.5aa5c910.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/11.b5f38301.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/12.ba6e3444.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/13.facb0d4d.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/14.5329ef33.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/15.b16af5b8.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/16.3ab9af64.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/17.89342c1c.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/18.4117a1ba.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/19.b7bced65.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/20.085877c0.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/21.7942a443.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/22.71c06ffc.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/23.7e0bb3f7.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/24.b3632420.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/26.003d03b5.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/27.d66536ec.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/28.4c5a65e7.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/29.cde76ea7.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/3.5220f451.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/30.431c8d21.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/31.b1bc10b5.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/32.0303e169.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/33.2fdafa57.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/4.17e14ac8.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/5.d496610c.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/6.edd4669e.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/7.9a67dd07.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/8.4431336c.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/9.d6068f70.js">
    <link rel="stylesheet" href="/LuckysheetDocs/assets/css/0.styles.48756c9a.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/LuckysheetDocs/zh/" class="home-link router-link-active"><img src="/LuckysheetDocs/img/logo.png" alt="Luckysheet文档" class="logo"> <span class="site-name can-hide">Luckysheet文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/LuckysheetDocs/zh/" class="nav-link">
  首页
</a></div><div class="nav-item"><a href="/LuckysheetDocs/zh/guide/" class="nav-link router-link-active">
  指南
</a></div><div class="nav-item"><a href="https://mengshukeji.github.io/LuckysheetDemo/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="了解更多" class="mobile-dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/LuckysheetDocs/zh/about/" class="nav-link">
  关于
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="选择语言" class="dropdown-title"><span class="title">选择语言</span> <span class="arrow down"></span></button> <button type="button" aria-label="选择语言" class="mobile-dropdown-title"><span class="title">选择语言</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/LuckysheetDocs/guide/FAQ.html" class="nav-link">
  English
</a></li><li class="dropdown-item"><!----> <a href="/LuckysheetDocs/zh/guide/FAQ.html" aria-current="page" class="nav-link router-link-exact-active router-link-active">
  简体中文
</a></li></ul></div></div> <a href="https://github.com/mengshukeji/Luckysheet" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/LuckysheetDocs/zh/" class="nav-link">
  首页
</a></div><div class="nav-item"><a href="/LuckysheetDocs/zh/guide/" class="nav-link router-link-active">
  指南
</a></div><div class="nav-item"><a href="https://mengshukeji.github.io/LuckysheetDemo/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="了解更多" class="mobile-dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/LuckysheetDocs/zh/about/" class="nav-link">
  关于
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="选择语言" class="dropdown-title"><span class="title">选择语言</span> <span class="arrow down"></span></button> <button type="button" aria-label="选择语言" class="mobile-dropdown-title"><span class="title">选择语言</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/LuckysheetDocs/guide/FAQ.html" class="nav-link">
  English
</a></li><li class="dropdown-item"><!----> <a href="/LuckysheetDocs/zh/guide/FAQ.html" aria-current="page" class="nav-link router-link-exact-active router-link-active">
  简体中文
</a></li></ul></div></div> <a href="https://github.com/mengshukeji/Luckysheet" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav>  <ul class="sidebar-links"><li><a href="/LuckysheetDocs/zh/guide/" aria-current="page" class="sidebar-link">快速上手</a></li><li><a href="/LuckysheetDocs/zh/guide/config.html" class="sidebar-link">整体配置</a></li><li><a href="/LuckysheetDocs/zh/guide/sheet.html" class="sidebar-link">工作表配置</a></li><li><a href="/LuckysheetDocs/zh/guide/cell.html" class="sidebar-link">单元格</a></li><li><a href="/LuckysheetDocs/zh/guide/operate.html" class="sidebar-link">表格操作</a></li><li><a href="/LuckysheetDocs/zh/guide/api.html" class="sidebar-link">API</a></li><li><a href="/LuckysheetDocs/zh/guide/resource.html" class="sidebar-link">教程与资源</a></li><li><a href="/LuckysheetDocs/zh/guide/FAQ.html" aria-current="page" class="active sidebar-link">常见问题</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-luckysheetfile中的data和celldata有什么区别" class="sidebar-link">** luckysheetfile中的data和celldata有什么区别？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-单元格的类型有哪些" class="sidebar-link">** 单元格的类型有哪些？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-如何在vue-react项目中使用luckysheet" class="sidebar-link">** 如何在Vue/React项目中使用Luckysheet？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-为什么初始化后表格里面的公式不会被触发" class="sidebar-link">** 为什么初始化后表格里面的公式不会被触发？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-远端加载数据是loadurl还是updateurl" class="sidebar-link">** 远端加载数据是loadUrl还是updateUrl？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-每个sheet页的index和order有什么区别" class="sidebar-link">** 每个sheet页的index和order有什么区别？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-dist文件夹下为什么不能直接运行项目" class="sidebar-link">** dist文件夹下为什么不能直接运行项目？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-excel导入导出怎么做" class="sidebar-link">** excel导入导出怎么做？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-初始化时合并单元格怎么做" class="sidebar-link">** 初始化时合并单元格怎么做？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-luckysheet如何把表格里的数据保存到数据库-有没有服务端存储和协作的解决方案" class="sidebar-link">** Luckysheet如何把表格里的数据保存到数据库？有没有服务端存储和协作的解决方案？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-如何监听单元格hover或者点击事件-cellrenderafter如何实时监听变化" class="sidebar-link">** 如何监听单元格hover或者点击事件？cellRenderAfter如何实时监听变化？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-顶部的工具栏不支持自定义配置" class="sidebar-link">** 顶部的工具栏不支持自定义配置？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-项目使用了jquery吗" class="sidebar-link">** 项目使用了jQuery吗？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-如何为单元格对象新增字段" class="sidebar-link">** 如何为单元格对象新增字段？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-工具栏图标加载不出来" class="sidebar-link">** 工具栏图标加载不出来？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-luckyexcel打包后不动" class="sidebar-link">** Luckyexcel打包后不动？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-单元格不可编辑如何控制-表格保护怎么操作" class="sidebar-link">** 单元格不可编辑如何控制？表格保护怎么操作？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-数据验证怎么配置" class="sidebar-link">** 数据验证怎么配置？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-luckysheet通过引入cdn有案例吗" class="sidebar-link">** Luckysheet通过引入CDN有案例吗？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-请问一下图片怎么限制在单元格里面自适应高度" class="sidebar-link">** 请问一下图片怎么限制在单元格里面自适应高度？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-如何获取工作表默认的行高列宽" class="sidebar-link">** 如何获取工作表默认的行高列宽？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-如何隐藏工作表下方的添加行按钮和回到顶部按钮" class="sidebar-link">** 如何隐藏工作表下方的添加行按钮和回到顶部按钮？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-如何隐藏工作表的行标题和列标题" class="sidebar-link">** 如何隐藏工作表的行标题和列标题？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-调用什么方法能设置config-merge" class="sidebar-link">** 调用什么方法能设置config.merge？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-为什么官方公布的新功能没有效果" class="sidebar-link">** 为什么官方公布的新功能没有效果？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-npm-run-dev报错-error-cannot-find-module-rollup" class="sidebar-link">** npm run dev报错：Error: Cannot find module 'rollup'？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-怎样在vue工程里对luckysheet进行二次开发" class="sidebar-link">** 怎样在vue工程里对Luckysheet进行二次开发？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-创建图表时候报错store-createchart" class="sidebar-link">** 创建图表时候报错Store.createChart？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-单元格能增加自定义属性吗" class="sidebar-link">** 单元格能增加自定义属性吗？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-如何输入以-开头的文本-例如-currentdate-yyyy-mm-dd-它默认会去掉函数-函数怎么禁止" class="sidebar-link">** 如何输入以'='开头的文本？例如=currentDate('YYYY-MM-DD')，它默认会去掉函数，函数怎么禁止？</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/FAQ.html#q-create回调为什么没有效果" class="sidebar-link">** create回调为什么没有效果？</a></li></ul></li><li><a href="/LuckysheetDocs/zh/guide/contribute.html" class="sidebar-link">贡献指南</a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="常见问题"><a href="#常见问题" class="header-anchor">#</a> 常见问题</h1> <p>本章内容搜集了大家反馈的常见问题，如果官方文档和此列表都不能解答您的疑问，推荐到<a href="https://support.qq.com/product/288322" target="_blank" rel="noopener noreferrer">官方论坛<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>反馈</p> <h2 id="q-luckysheetfile中的data和celldata有什么区别"><a href="#q-luckysheetfile中的data和celldata有什么区别" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> luckysheetfile中的data和celldata有什么区别？</h2> <p><strong><span style="font-size:20px;">A</span></strong> : 表格初始化时使用一维数组格式的 <a href="/LuckysheetDocs/zh/guide/sheet.html#celldata">celldata</a>，初始化完成后转化为二维数组格式的data作为存储更新使用，celldata不再使用。</p> <p>如果需要将<code>data</code>拿出来作为初始化数据，则需要执行 <a href="/LuckysheetDocs/zh/guide/api.html#transtocelldata-data-setting">transToCellData(data)</a>转换为celldata数据。
其中<code>{ r, c, v }</code>格式的celldata转换为二维数组使用的是<a href="/LuckysheetDocs/zh/guide/api.html#transtodata-celldata-setting">transToData(celldata)</a></p> <p>总结如下：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// data =&gt; celldata 二维数组数据 转化成 {r, c, v}格式 一维数组</span>
luckysheet<span class="token punctuation">.</span><span class="token function">transToCellData</span><span class="token punctuation">(</span>data<span class="token punctuation">)</span>

<span class="token comment">// celldata =&gt; data 生成表格所需二维数组</span>
luckysheet<span class="token punctuation">.</span><span class="token function">transToData</span><span class="token punctuation">(</span>celldata<span class="token punctuation">)</span>
</code></pre></div><hr> <h2 id="q-单元格的类型有哪些"><a href="#q-单元格的类型有哪些" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 单元格的类型有哪些？</h2> <p><strong><span style="font-size:20px;">A</span></strong> : 参考<a href="/LuckysheetDocs/zh/guide/cell.html">单元格格式列表</a>,例举了可用的单元格格式</p> <hr> <h2 id="q-如何在vue-react项目中使用luckysheet"><a href="#q-如何在vue-react项目中使用luckysheet" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 如何在Vue/React项目中使用Luckysheet？</h2> <p><strong><span style="font-size:20px;">A</span></strong> :</p> <ul><li>Vue案例：<a href="https://github.com/mengshukeji/luckysheet-vue" target="_blank" rel="noopener noreferrer">luckysheet-vue<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li>React案例：<a href="https://github.com/mengshukeji/luckysheet-react" target="_blank" rel="noopener noreferrer">luckysheet-react<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <hr> <h2 id="q-为什么初始化后表格里面的公式不会被触发"><a href="#q-为什么初始化后表格里面的公式不会被触发" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 为什么初始化后表格里面的公式不会被触发？</h2> <p><strong><span style="font-size:20px;">A</span></strong> : 参考 <a href="/LuckysheetDocs/zh/guide/sheet.html#calcchain">表格数据格式</a> ,设置单元格数据对应的calcChain即可。</p> <hr> <h2 id="q-远端加载数据是loadurl还是updateurl"><a href="#q-远端加载数据是loadurl还是updateurl" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 远端加载数据是loadUrl还是updateUrl？</h2> <p><strong><span style="font-size:20px;">A</span></strong> : <a href="/LuckysheetDocs/zh/guide/config.html#loadurl">loadUrl</a>。配置了loadUrl，Luckysheet会通过ajax请求整个表格数据，而updateUrl会作为协同编辑实时保存的接口地址。
注意：初始化数据需要配置loadUrl参数，而协同编辑则在配置loadUrl、updateUrl和allowUpdate四个参数才能生效。</p> <hr> <h2 id="q-每个sheet页的index和order有什么区别"><a href="#q-每个sheet页的index和order有什么区别" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 每个sheet页的<code>index</code>和<code>order</code>有什么区别？</h2> <p><strong><span style="font-size:20px;">A</span></strong> : 每个sheet页都有一个唯一id，就是<code>index</code>，可以用数字递增，也可以使用随机字符串，而<code>order</code>是所有的sheet的排序情况，从0开始，只能为数字<code>0,1,2...</code>。</p> <hr> <h2 id="q-dist文件夹下为什么不能直接运行项目"><a href="#q-dist文件夹下为什么不能直接运行项目" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> dist文件夹下为什么不能直接运行项目？</h2> <p><strong><span style="font-size:20px;">A</span></strong> :需要启动本地服务器</p> <ul><li><a href="https://github.com/JacksonTian/anywhere" target="_blank" rel="noopener noreferrer">Node搭建本地服务器<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://developer.mozilla.org/zh-CN/docs/Learn/Common_questions/set_up_a_local_testing_server" target="_blank" rel="noopener noreferrer">Python搭建本地服务器<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <hr> <h2 id="q-excel导入导出怎么做"><a href="#q-excel导入导出怎么做" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> excel导入导出怎么做？</h2> <p><strong><span style="font-size:20px;">A</span></strong> :配合Luckysheet开发的excel导入导出库-<a href="https://github.com/mengshukeji/Luckyexcel" target="_blank" rel="noopener noreferrer">Luckyexcel<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>已经实现了excel导入功能，导出功能正在开发当中。现阶段excel导出可以参考这2篇博文：</p> <ul><li><a href="https://www.cnblogs.com/recode-hyh/p/13168226.html" target="_blank" rel="noopener noreferrer">基于LuckySheet在线表格的Excel下载功能开发<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://blog.csdn.net/csdn_lsy/article/details/107179708" target="_blank" rel="noopener noreferrer">使用exceljs导出luckysheet表格<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <hr> <h2 id="q-初始化时合并单元格怎么做"><a href="#q-初始化时合并单元格怎么做" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 初始化时合并单元格怎么做？</h2> <p><strong><span style="font-size:20px;">A</span></strong> :参考以下案例</p> <ul><li><a href="https://www.cnblogs.com/DuShuSir/p/13272397.html" target="_blank" rel="noopener noreferrer">Luckysheet如何初始化含合并单元格的数据<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <hr> <h2 id="q-luckysheet如何把表格里的数据保存到数据库-有没有服务端存储和协作的解决方案"><a href="#q-luckysheet如何把表格里的数据保存到数据库-有没有服务端存储和协作的解决方案" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> Luckysheet如何把表格里的数据保存到数据库？有没有服务端存储和协作的解决方案？</h2> <p><strong><span style="font-size:20px;">A</span></strong> :有两个方案：</p> <ul><li>一是表格操作完成后，使用<code>luckysheet.getAllSheets()</code>方法获取到全部的工作表数据，全部发送到后台存储。</li> <li>二是开启协同编辑功能，实时传输数据给后端。
具体的操作步骤参考这篇文章：<a href="https://www.cnblogs.com/DuShuSir/p/13857874.html" target="_blank" rel="noopener noreferrer">Luckysheet如何把表格里的数据保存到数据库<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <hr> <h2 id="q-如何监听单元格hover或者点击事件-cellrenderafter如何实时监听变化"><a href="#q-如何监听单元格hover或者点击事件-cellrenderafter如何实时监听变化" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 如何监听单元格hover或者点击事件？<code>cellRenderAfter</code>如何实时监听变化？</h2> <p><strong><span style="font-size:20px;">A</span></strong> ：我们搜集到需要针对单元格事件的二次开发需求，规划了单元格相关的钩子函数，参考<a href="/LuckysheetDocs/zh/guide/config.html#cellrenderafter">单元格钩子函数</a>（显示的TODO的暂未开放）</p> <hr> <h2 id="q-顶部的工具栏不支持自定义配置"><a href="#q-顶部的工具栏不支持自定义配置" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 顶部的工具栏不支持自定义配置？</h2> <p><strong><span style="font-size:20px;">A</span></strong> ：
顶部工具栏的自定义配置使用初始<a href="/LuckysheetDocs/zh/guide/config.html#showtoolbarconfig">options.showtoolbarconfig</a>(如果标注TODO表示暂未开发)</p> <hr> <h2 id="q-项目使用了jquery吗"><a href="#q-项目使用了jquery吗" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 项目使用了jQuery吗？</h2> <p><strong><span style="font-size:20px;">A</span></strong> ：是的。Luckysheet内部启动时间比开源的时间早很多，所以用到了jQuery。打包工具会把jQuery集成到打包目录的<code>./plugins/js/plugin.js</code>文件中。</p> <p>如果您的项目中（比如React/Vue）也自己全局引用了jQuery，且造成了冲突，可以尝试去掉一个jQuery。</p> <p>要想在Luckysheet里去除jQuery，需要在源码根目录下的<code>gulpfile.js</code>文件中找到打包jQuery的地方：<a href="https://github.com/mengshukeji/Luckysheet/blob/master/gulpfile.js" target="_blank" rel="noopener noreferrer">src/plugins/js/jquery.min.js<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>，删除jQuery相关的信息即可。</p> <hr> <h2 id="q-如何为单元格对象新增字段"><a href="#q-如何为单元格对象新增字段" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 如何为单元格对象新增字段？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 首先参考<a href="/LuckysheetDocs/zh/guide/cell.html">单元格对象格式</a>，然后参照源码批注的部分<a href="https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/postil.js" target="_blank" rel="noopener noreferrer">src/controllers/postil.js<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>。批注是一个加在单元格对象上的一个配置。</p> <hr> <h2 id="q-工具栏图标加载不出来"><a href="#q-工具栏图标加载不出来" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 工具栏图标加载不出来？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 工具栏及其他部分图标采用了iconfont图标，加载不出来是因为缺少了iconfont.css的引入，之前旧版官方文档未写清楚这一点对大家造成误导，很抱歉。</p> <p>详细的Luckysheet使用教程参考已经更新的<a href="/LuckysheetDocs/zh/guide/#使用步骤">官方文档</a></p> <hr> <h2 id="q-luckyexcel打包后不动"><a href="#q-luckyexcel打包后不动" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> Luckyexcel打包后不动？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 打包的终端命令行不显示结束，但是如果<code>dist</code>文件夹内已经有了结果文件<code>luckyexcel.js</code>，则表明是正常的。</p> <p>Luckyexcel是excel导入导出库，项目采用了gulp作为打包工具，旧版打包工具有点问题在命令行显示这块有些问题，问题已经修复。请还出现此问题的小伙伴做如下更新操作：</p> <ol><li>pull最新代码</li> <li><code>npm i</code></li> <li><code>npm run build</code></li></ol> <p>更多详细信息关注：<a href="https://github.com/mengshukeji/Luckyexcel/" target="_blank" rel="noopener noreferrer">Luckyexcel<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <hr> <h2 id="q-单元格不可编辑如何控制-表格保护怎么操作"><a href="#q-单元格不可编辑如何控制-表格保护怎么操作" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 单元格不可编辑如何控制？表格保护怎么操作？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 单元格不可编辑属于工作表保护的功能范畴，需要配置在每个sheet页中<code>config.authority</code>，最新的设置参数请参考<a href="/LuckysheetDocs/zh/guide/sheet.html#config-authority">工作表保护</a>。</p> <p>为了大家便于理解工作表保护的功能使用，下方的视频演示了如何让当前整个工作表不可编辑，但是允许某一列单元格可编辑的功能：</p> <iframe frameborder="0" src="https://v.qq.com/txp/iframe/player.html?vid=g3162sacwn6" allowFullScreen="true"></iframe> <p>跟着演示操作一下本地的工作表，然后打开浏览器控制台，使用<code>luckysheet.getLuckysheetfile()[0].config.authority</code>就可以获取到第一个工作表的工作表保护参数。</p> <hr> <h2 id="q-数据验证怎么配置"><a href="#q-数据验证怎么配置" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 数据验证怎么配置？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 最新文档已经提供了数据验证的配置信息，参考<a href="/LuckysheetDocs/zh/guide/sheet.html#dataVerification">数据验证配置</a>。官方也提供了API方法 <a href="/LuckysheetDocs/zh/guide/api.html#setdataverification-optionitem-setting">setDataVerification</a>，用于动态设置数据验证功能。</p> <hr> <h2 id="q-luckysheet通过引入cdn有案例吗"><a href="#q-luckysheet通过引入cdn有案例吗" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> Luckysheet通过引入CDN有案例吗？</h2> <p><strong><span style="font-size:20px;">A</span></strong> Luckysheet支持CDN方式引入，参考：<a href="https://www.cnblogs.com/DuShuSir/p/13859103.html" target="_blank" rel="noopener noreferrer">本地HTML采用cdn加载方式引入Luckysheet的案例<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <hr> <h2 id="q-请问一下图片怎么限制在单元格里面自适应高度"><a href="#q-请问一下图片怎么限制在单元格里面自适应高度" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 请问一下图片怎么限制在单元格里面自适应高度？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 首先需要对图片设置移动并调整单元格大小，然后有以下几种情况：</p> <ul><li>如果图片位置完全在单元格内部时，当拉长单元格的宽度或高度的时候，图片不会随着单元格的变大而伸缩变大</li> <li>如果图片位置完全在单元格内部时，当拉短单元格的宽度或高度，贴到图片的边时，图片会随着单元格的变小而伸缩变小</li> <li>当这个图片超过单元格的边框时，图片可以跟随单元格大小变化</li></ul> <p>根据图片的第二个特性，可以操作得到图片位置信息，原理就是将图片的位置设置成和单元格边框重叠（源码中，需要重叠超过2px），以下演示视频展示了怎么将图片限制在单元格里面自适应宽高。</p> <iframe frameborder="0" src="https://v.qq.com/txp/iframe/player.html?vid=y3163ya0q6c" allowFullScreen="true"></iframe> <hr> <h2 id="q-如何获取工作表默认的行高列宽"><a href="#q-如何获取工作表默认的行高列宽" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 如何获取工作表默认的行高列宽？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 有两种方式可以获取</p> <ul><li>一是使用<code>luckysheet.getLuckysheetfile()</code>获取到所有工作表配置后，在各个工作表的配置中直接取得默认行高<code>defaultRowHeight</code>和默认列宽<code>defaultColWidth</code>。</li> <li>二是开放了API可以获取到工作表默认的行高<a href="/LuckysheetDocs/zh/guide/api.html#getdefaultrowheight-setting">getDefaultRowHeight</a>和列宽<a href="/LuckysheetDocs/zh/guide/api.html#getdefaultcolwidth-setting">getDefaultColWidth</a></li></ul> <hr> <h2 id="q-如何隐藏工作表下方的添加行按钮和回到顶部按钮"><a href="#q-如何隐藏工作表下方的添加行按钮和回到顶部按钮" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 如何隐藏工作表下方的添加行按钮和回到顶部按钮？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 已开放配置</p> <ul><li>允许添加行 <a href="/LuckysheetDocs/zh/guide/config.html#enableaddrow">enableAddRow</a></li> <li>允许回到顶部 <a href="/LuckysheetDocs/zh/guide/config.html#enableAddBackTop">enableAddBackTop</a></li></ul> <hr> <h2 id="q-如何隐藏工作表的行标题和列标题"><a href="#q-如何隐藏工作表的行标题和列标题" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 如何隐藏工作表的行标题和列标题？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 已开放配置</p> <ul><li>行标题区域的宽度 <a href="/LuckysheetDocs/zh/guide/config.html#rowheaderwidth">rowHeaderWidth</a></li> <li>列标题区域的高度 <a href="/LuckysheetDocs/zh/guide/config.html#columnHeaderHeight">columnHeaderHeight</a></li></ul> <hr> <h2 id="q-调用什么方法能设置config-merge"><a href="#q-调用什么方法能设置config-merge" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 调用什么方法能设置<code>config.merge</code>？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 三个方法</p> <ul><li>界面操作</li> <li>用API：<a href="/LuckysheetDocs/zh/guide/api.html#setrangemerge-type-setting">setRangeMerge</a></li> <li>手动组装merge参数</li></ul> <hr> <h2 id="q-为什么官方公布的新功能没有效果"><a href="#q-为什么官方公布的新功能没有效果" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 为什么官方公布的新功能没有效果？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 第一步，检查下您是否使用了CDN的方式引入，</p> <p>Luckysheet教程里采用的CDN链接是 <a href="https://www.jsdelivr.com/package/npm/luckysheet" target="_blank" rel="noopener noreferrer">jsdelivr<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> 提供的服务，代码是从 <a href="https://www.npmjs.com/" target="_blank" rel="noopener noreferrer">npmjs.com<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> 自动同步过去的，不是从 <a href="https://github.com/mengshukeji/Luckysheet/" target="_blank" rel="noopener noreferrer">Github<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> 同步过去的。因为我们新提交的代码，还需要经过一段时间的测试，所以不会立即发布到npm使用，导致了npm的代码稍滞后于Github。</p> <p>如果需要尝试最新代码，我们强烈建议您从 <a href="https://github.com/mengshukeji/Luckysheet/" target="_blank" rel="noopener noreferrer">Luckysheet Github<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> 主仓库拉取代码。后续我们版本稳定了，会考虑实时发布npm包。</p> <p>第二步，如果是引用github仓库打包后的代码，测试判断是否有bug，您可以查找问题并尝试修复，再<a href="https://github.com/mengshukeji/Luckysheet/pulls" target="_blank" rel="noopener noreferrer">提交PR<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>，如果修复不了，请<a href="https://github.com/mengshukeji/Luckysheet/issues" target="_blank" rel="noopener noreferrer">提交issues<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>。</p> <hr> <h2 id="q-npm-run-dev报错-error-cannot-find-module-rollup"><a href="#q-npm-run-dev报错-error-cannot-find-module-rollup" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> <code>npm run dev</code>报错：<code>Error: Cannot find module 'rollup'</code>？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 可能是npm包安装问题，尝试以下步骤：</p> <ol><li><code>npm cache clean --force</code></li> <li><code>npm i rimraf -g</code></li> <li><code>rimraf node_modules</code></li> <li>删除package-lock.json文件</li> <li><code>npm i</code></li> <li><code>npm run dev</code></li></ol> <p>提示：大多数的其他npm安装问题，也可以尝试此步骤来解决。</p> <hr> <h2 id="q-怎样在vue工程里对luckysheet进行二次开发"><a href="#q-怎样在vue工程里对luckysheet进行二次开发" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 怎样在vue工程里对Luckysheet进行二次开发？</h2> <p><strong><span style="font-size:20px;">A</span></strong> <a href="https://github.com/mengshukeji/luckysheet-vue" target="_blank" rel="noopener noreferrer">luckysheet-vue<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> 案例是提供一个应用集成的方案。</p> <p>如果本地直接开发的话：</p> <ol><li>把Luckysheet的工程和自己的Vue工程都启动起来，比如Luckysheet的工程在 <code>http://localhost:3001</code></li> <li>在Vue工程里面通过 <code>http://localhost:3001</code> 引入Luckysheet使用</li></ol> <p>这样的话，Luckysheet实时修改后，Vue工程里是可以看到更改的</p> <hr> <h2 id="q-创建图表时候报错store-createchart"><a href="#q-创建图表时候报错store-createchart" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 创建图表时候报错<code>Store.createChart</code>？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 需要引入图表插件才能使用，工作簿初始化的时候应该配置图表插件使用，参考</p> <ul><li>插件配置 <a href="/LuckysheetDocs/zh/guide/config.html#配置项">plugins</a></li> <li>或 官方demo <a href="https://github.com/mengshukeji/Luckysheet/blob/master/src/index.html" target="_blank" rel="noopener noreferrer">/src/index.html<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <hr> <h2 id="q-单元格能增加自定义属性吗"><a href="#q-单元格能增加自定义属性吗" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 单元格能增加自定义属性吗？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 直接赋值到单元格对象上的自定义属性会被过滤，要想使得自定义属性生效，需要二开去除过滤属性的代码。</p> <hr> <h2 id="q-如何输入以-开头的文本-例如-currentdate-yyyy-mm-dd-它默认会去掉函数-函数怎么禁止"><a href="#q-如何输入以-开头的文本-例如-currentdate-yyyy-mm-dd-它默认会去掉函数-函数怎么禁止" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> 如何输入以<code>'='</code>开头的文本？例如<code>=currentDate('YYYY-MM-DD')</code>，它默认会去掉函数，函数怎么禁止？</h2> <p><strong><span style="font-size:20px;">A</span></strong> 前面加一个单引号就行，会强制识别为字符串，和excel表现一致的。比如：<code>'=currentDate('YYYY-MM-DD')</code></p> <hr> <h2 id="q-create回调为什么没有效果"><a href="#q-create回调为什么没有效果" class="header-anchor">#</a> <strong><span style="font-size:20px;">Q</span></strong> create回调为什么没有效果？</h2> <p><strong><span style="font-size:20px;">A</span></strong> API 方法<code>luckysheet.create()</code>这个方法没有回调，但是Luckysheet提供了钩子函数用于在指定位置执行回调方法，比如：</p> <ul><li>表格创建之前触发 <a href="/LuckysheetDocs/zh/guide/config.html#workbookcreatebefore">workbookCreateBefore</a></li> <li>表格创建之后触发 <a href="/LuckysheetDocs/zh/guide/config.html#workbookcreateafter">workbookCreateAfter</a></li></ul> <hr></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/mengshukeji/Luckysheet/edit/master/docs/zh/guide/FAQ.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">12/17/2020, 8:23:07 AM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/LuckysheetDocs/zh/guide/resource.html" class="prev">
        教程与资源
      </a></span> <span class="next"><a href="/LuckysheetDocs/zh/guide/contribute.html">
        贡献指南
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/LuckysheetDocs/assets/js/app.fd749708.js" defer></script><script src="/LuckysheetDocs/assets/js/2.08ae9631.js" defer></script><script src="/LuckysheetDocs/assets/js/25.af0769a6.js" defer></script>
  </body>
</html>
